<?php

	class ContactController extends AppController {
		var $name = 'Contact';
		var $uses = array(); // ContactShop
		var $components = array('Email');
		
		var $publicAction = array('index', 'quotation');
		
		function index() {
			$this->pageTitle = __('Contacto', true);
			$email = Configure::read('Shop.email');
			
			if (!empty($this->data)) {
				$this->Email->to = $email;
				$this->Email->subject = __('Contacto desde ' . Configure::read('Shop.name'));
				$this->Email->send();
			}
			
			if (empty($email)) {
				$this->Session->setFlash(__('En estos momentos no es imposible que te comuniques con nosotros, pronto habilitaremos esta opción.', true), 'default', array('class' => 'info'));
				$this->redirect(array('shop' => Configure::read('Shop.slug'), 'controller' => 'shops', 'action' => 'index'));
			}
		}
		
		function quotation() {
			
		}
	}
